package com.wsoft.bpm.node;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

/**
 * TODO
 *
 * @Author zhonglj
 * @Date 2024-09-10 18:08
 */
@Setter
@Getter
@Accessors(chain = true)
public class FormProperty extends ActivityXml {
    private String id;
    private String name;
    private String type;
    private String expression;
    private String variable;
    private String defaultValue;
    private String datePattern;
    private String readable;
    private String writeable;
    private String required;
    private List<FormValue> formValues;

    public FormProperty() {
        this.setTagName("activiti:formProperty");
        this.putXmlKey("defaultValue", "default");
    }

    public FormProperty addFormValue(FormValue value) {
        if (formValues == null) {
            formValues = new ArrayList<>();
        }
        formValues.add(value);
        return this;
    }
}
